/*
 * main.c
 *
 *  Created on: 2012-12-12
 *      Author: macro
 */
#include"lsdb/dbm_lsdb_manager.h"
#include "lsdb/lsdb.h"
#include "dbm_conf.h"
#include "server/dbm_socket.h"
#include "pdb/policy_parse.h"

unsigned int dbm_status;
u_char self_module;

int main(){
	USING(timer);
	USING(dbm_manager);
	USING(pdb_manager);
	USING(dbm);
		if(dbm_start()!=0)
		{
			DEBUG(INFO,"DBM start failed");
			return -1;
		}
		/*
	struct cr_lsdb_link_state lsa[10];
	int i;
	for(i=0;i<10;i++){
		lsa[i].key.rt_id = i+1;
		lsa[i].key.if_id = 1;
		lsa[i].key.n_if_id = 2;
		lsa[i].key.n_rt_id = i+1;
		lsa[i].metric = i+1;
		lsa[i].state = i+1;
		add_link_state_to_area(&lsa[i],0);
	}
	struct cr_lsdb_link_state lsb[10];

		for(i=0;i<10;i++){
			lsb[i].key.rt_id = i+1;
			lsb[i].key.if_id = 1;
			lsb[i].key.n_if_id = 1;
			lsb[i].key.n_rt_id = i+1;
			lsb[i].metric = i+100;
			//update_link_state_to_area(&lsb[i],0);
		}
	printf("finish\n");
	for(i=1;i<4;i++){
	show_lsdb(i);
	//show_az_info(i);
}
	struct cr_lsdb_link_state lsaa;
	//if(FOUND == find_link_state(&(lsb[4].key),&lsaa,3,az_head)){
	//	printf("found a lsa\n");
	//		show_ls(&lsaa);
	//}
	//dbm_create_snapshoot();
*/
}
